<!-- 头部 -->
<include file="Public:header" />

        <!-- header-section end-->
        <div class="index-wrapper" style="padding-bottom: 0px;">
            <div style="background: #fff;padding-left: 25px;font-size: 15px;padding-top: 5px;">我的礼卷</div>
            <!-- 楼层显示 -->
            <div class="product-list" style="background: #fff;padding: 10px;margin: 0px;">
            <?php foreach ($myljs as $v) { ?>
                <?php if ($v['is_sy'] == 1) { ?>
                <a style="width: 100%;height: 100px;padding: 0px;margin-bottom: 20px;">
                    <div style="float: left;width: 100px;height: 60px;background: #C8C8C8;margin: 18px;text-align: center;line-height: 60px;font-size: 18px;font-weight: bold;color: #fff;">{$v.xioc}</div>
                    <div style="height: 100px;background: #FAFAFA;box-shadow: 0px 1px 3px rgba(34, 25, 25, 0.2)">
                        <p style="padding: 15px 5px;font-weight: bold;">{$v.title}</p>
                        <p style="padding: 0px 5px;position: absolute;left: 140px;width: 120px;">礼卷使用成功,请保持手机畅通</p>
                        <p style="position: relative;top: -50px;left: 82%;width: 68px;height: 102px;background: #C8C8C8;">
                            <span style="position: absolute;display: block;color: #fff;width: 25px;left: 25px;top: 20px;">已使用</span>
                        </p>
                    </div>
                </a>
                <?php }else { ?>
                <a style="width: 100%;height: 100px;padding: 0px;margin-bottom: 20px;">
                    <div style="float: left;width: 100px;height: 60px;background: #FFB604;margin: 18px;text-align: center;line-height: 60px;font-size: 18px;font-weight: bold;color: #fff;">{$v.xioc}</div>
                    <div style="height: 100px;background: #FAFAFA;box-shadow: 0px 1px 3px rgba(34, 25, 25, 0.2)">
                        <p style="padding: 15px 5px;font-weight: bold;">{$v.title}</p>
                        <p style="padding: 10px 5px;position: absolute;left: 140px;">{$v.time|date="y-m-d H:i",###}</p>
                        <p style="position: relative;top: -50px;left: 82%;width: 68px;height: 102px;background: #FF932D;">
                            <span onclick="member_del(this,'{$v.id}')" style="position: absolute;display: block;color: #fff;width: 25px;left: 25px;top: 10px;">马上使用</span>
                        </p>
                    </div>
                </a>
                <?php } ?>
            <?php } ?>
            </div>
            <div style="height: 10px;"></div>
            <!-- 底部 -->
            <div class="tabbar-section" style="text-align: center;font-size: 12px;padding-top: 10px;background: #fff;padding-bottom: 10px;">
                <ul id="J-tabbar" class="ui-flex">
                    <li class="cell">
                        <a class="tabbar-nav" href="{:U('index/index')}">
                            <img src="__PUBLIC__/home/images/sy1.png" alt=""><p style="font-size: 15px;">首页</p>
                        </a>
                    </li>
                    <li class="cell J-other">
                    <?php if (!empty(session('name'))) { ?>
                        <a class="tabbar-nav" href="{:U('setup/index')}">
                            <img src="__PUBLIC__/home/images/fq2.png" alt=""><p style="font-size: 15px;">创建</p>
                        </a>
                    <?php } else { ?>
                        <a class="tabbar-nav" href="{:U('user/login')}">
                            <img src="__PUBLIC__/home/images/fq2.png" alt=""><p style="font-size: 15px;">创建</p>
                        </a>
                    <?php } ?>
                    </li>
                    <li class="cell J-other">
                        <a class="tabbar-nav" href="{:U('index/xms')}">
                            <img src="__PUBLIC__/home/images/xm3.png" alt=""><p style="font-size: 15px;">项目</p>
                        </a>
                    </li>
                    <li class="cell J-other">
                    <?php if (!empty(session('name'))) { ?>
                        <a class="tabbar-nav" href="{:U('user/yhzx')}">
                            <img src="__PUBLIC__/home/images/xwd4.png" alt=""><p style="color:#FF9027;font-size: 15px;">我的</p>
                        </a>
                    <?php } else { ?>
                        <a class="tabbar-nav" href="{:U('user/login')}">
                            <img src="__PUBLIC__/home/images/wd4.png" alt=""><p style="font-size: 15px;">我的</p>
                        </a>
                    <?php } ?>
                    </li>
                </ul>
            </div>
        </div>
    <script>
        layui.use(['form','layer'], function(){
           $ = layui.jquery;
          var layer = layui.layer
          ,form = layui.form();
          //layer.msg('Hello World');
        });
        /*状态*/
        function member_del(obj,id){
            layer.confirm('确认要使用礼卷吗？',function(index){
                //发异步删除数据
                id = id;
                $.ajax({
                    url: "{:U('user/ismylj')}",//请求地址
                    type: "post",//请求方式
                    dataType: "json",//返回数据类型
                    data: {id:id},//发送的参数
                    })
                    .done(function(response) {
                          if(response.error==1){
                            layer.msg(response.info ,{icon:6});
                            location.reload();
                          }else{
                            layer.msg(response.info ,{icon:5});
                          }
                      })
                    .fail(function() {
                        alert("ajxs交互失败");
                    })  
                return false;
            });
        }
    </script>
    </body>
</html>